package com.diy.sigmund.diycommon.spring.extensionpoint;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * @author ylm-sigmund
 * @since 2022/9/20 18:21
 */
// @Component
public class CustomFactoryBean implements FactoryBean<CustomFactoryBean.CustomInnerFactoryBean> {

    private static final Logger log = LoggerFactory.getLogger(CustomFactoryBean.class);

    @Override
    public CustomInnerFactoryBean getObject() throws Exception {
        log.info("CustomInnerFactoryBean.getObject");
        return new CustomInnerFactoryBean();
    }

    @Override
    public Class<?> getObjectType() {
        log.info("CustomInnerFactoryBean.getObjectType");
        return CustomInnerFactoryBean.class;
    }

    @Override
    public boolean isSingleton() {
        log.info("CustomInnerFactoryBean.isSingleton");
        return true;
    }

    public static class CustomInnerFactoryBean {

    }
}
